package cz.muni.fi.pb138.eis_core;

import java.util.List;
import javax.xml.xquery.XQException;

/**
 * Provides persistence for ExpositionEntity
 * 
 * @author Jakub Senko
 */
public interface ExpositionManager
{
    /**
     * Adds entity into database.
     * 
     * @param entity Entity to be added into database
     * @throws XQException An exception that provides information on XQJ, XQuery or other errors reported by an XQJ implementation.
     */
    public void create(ExpositionEntity entity) throws XQException;
    
    /**
     * Selects entity, that is selected by ID from database.
     * 
     * @param id id of the wanted entity
     * @return wanted entity
     * @throws XQException An exception that provides information on XQJ, XQuery or other errors reported by an XQJ implementation.
     */
    public ExpositionEntity getById(long id) throws XQException;
    
    /**
     * Creates list of entities, which are in database.
     * 
     * @return list of wanted entities
     * @throws XQException An exception that provides information on XQJ, XQuery or other errors reported by an XQJ implementation.
     */
    public List<ExpositionEntity> getAll() throws XQException;
    
    /**
     * Deletes entity selected by ID from database.
     * 
     * @param entity entity to be deleted from database
     * @return true if artwork was deleted
     *         false if operation failed
     * @throws XQException An exception that provides information on XQJ, XQuery or other errors reported by an XQJ implementation.
     */
    public boolean delete(ExpositionEntity entity) throws XQException;
}
